home *** CD-ROM | disk | FTP | other *** search
- -- Merge Framed Stories
- -- 10 November 96, vs
-
- -- This script will merge two framed stories
- -- into a single threaded story. You need to
- -- select the last frame of one story and the first
- -- frame of another story.
- -- (Caution: If the text blocks contain hyperlink
- -- sources or anchors, they may be moved to an
- -- unexpected position by this script.)
-
- getselectidlist >> n,id1,z1,...,...,...,...,...,...,...,...,...,...,...,...,...,id2,z2,...
- if not(n=2)
- message "Invalid state, two objects must be selected."
- return
- endif
- selectid id1
- getisframe >> f1
- try getnextframe 1 >> id1.prev
- try getnextframe 0 >> id1.next
- selectid id2
- getisframe >> f2
- try getnextframe 1 >> id2.prev
- try getnextframe 0 >> id2.next
- if f1*f2=0
- message "Invalid state"
- return
- endif
- if (id1.next = -1)*(id2.prev =-1)
- goto validState
- endif
- if (id1.prev = -1)*(id2.next =-1)
- id1,id2 = id2,id1
- goto validState
- endif
- message "Invalid state. You need to select the last frame of one story "
- message "and the first frame of another story."
- return
- label validState
- selectid id2
- textedit;selectall;cut;deselect
- try linkframes 2,id1,id2
- getlasterror >> err
- if err
- selectid id2
- getobjectloc center >> c
- newstory c
- paste
- message "Cannot link selected frames."
- return
- endif
- selectid id1
- textedit
- textcursor +story
- paste
- deselect
- selectid id1
- selectidextend id2
- return
-
-